import Vue from 'vue'
import Router from 'vue-router'

//静态导入
import Home from './views/Home'
//异步导入(视频上推荐这种方式)
const About = () => import('./views/About');
const Test = () => import('./views/Test');
const For = () => import('./views/For');
const Event = () => import('./views/Event');
const Cal = () => import('./views/CalAndLisAttr');
const ImAxios = () => import('./views/ImportAxios');
const Moment = () => import('./views/MonentDemo');
// eslint-disable-next-line no-unused-vars
const Command = () => import('./views/Command.vue')
const Layout = () => import('./page/Layout.vue')
const AutoCompleteTest = () => import('./page/AutoCompleteTest.vue')
const FileManager = () => import('./page/FileManager.vue')
const TreeDemo = () => import('./page/TreeDemo.vue')

Vue.use(Router);

export default new Router({
    routes: [
        {
            path: '/',
            name: 'home',
            component: Home
        },
        {
            path: '/about',
            name: 'about',
            component: About
        },
        {
            path: '/test',
            name: 'test',
            component: Test
        },
        {
            path: '/for',
            name: 'for',
            component: For
        },
        {
            path: '/event',
            name: 'event',
            component: Event
        },
        {
            path: '/cal',
            name: 'cal',
            component: Cal
        },
        {
            path: '/axios',
            name: 'axios',
            component: ImAxios
        },
        {
            path: '/moment',
            name: 'moment',
            component: Moment
        },
        {
            path: '/command',
            name: 'command',
            component: Command
        },
        {
            path: '/layout',
            name: 'layout',
            component: Layout
        },
        {
            path: '/autoCompleteTest',
            name: 'autoCompleteTest',
            component: AutoCompleteTest
        },
        {
            path: '/fileManager',
            name: 'fileManager',
            component: FileManager
        },
        {
            path: '/treeDemo',
            name: 'treeDemo',
            component: TreeDemo
        }
    ],
    //设置路由的根请求内容, 可以设置为'demo'观察效果
    base: process.env.BASE_URL,
    mode: 'history'
})